<!DOCTYPE html>
<html lang="en">
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/laypage.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/jquery.validation/1.14.0/jquery.validate.min.js"></script>
    <script src="/js/jquery.validation/1.14.0/messages_zh.min.js"></script>
    <script src="/js/vue/vue.min.js"></script>
    <script src="/js/layer/layer.js" charset="utf-8"></script>
</head>
<body>
<section id="container">

    <section id="main-content">

            <div class="row">
                <div class="col-lg-12" id="app">
                    <section class="panel">
                        <header class="panel-heading">
                            修改套餐
                        </header>
                        <div class="panel-body" >
                            <div class="form">
                                <form class="cmxform form-horizontal" id="updateComboForm">
                                    <input type="hidden" value="${combo1.comuuid}" name="comuuid" id="comuuid">
                                    <div class="form-group ">
                                        <label for="combname" class="control-label col-lg-3">套餐名称</label>
                                        <div class="col-lg-6">
                                            <input type="hiden" value="${combo1.combname}" id="combname" name="combname" >
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <label for="maxinsur" class="control-label col-lg-3">套餐内容</label>
                                        <table>
                                            <#list combo1.list as str>
                                            <tr>
                                                <td>${str.insurname}</td>
                                            </tr>
                                            </#list>
                                        </table>
                                    </div>
                                    <div class="form-group ">
                                        <label for="combrate" class="control-label col-lg-3">套餐优惠率</label>
                                        <div class="col-lg-6">
                                            <input type="hiden" value="${(combo1.combrate)?string("0.##")}" id="combrate" name="combrate" >
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-lg-offset-3 col-lg-6">
                                            <button class="btn btn-primary" type="button" id="referBut">提交</button>
                                            <button class="btn btn-primary" type="button" id="cancelBut">取消修改</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
            </div>
        </section>

    </section>
</section>

</body>
</html>
<script>
    var  updateCombo= function () {
        $.ajax({
            url: "/comb/updateCombo.do",
            type: "post",
            data: $("#updateComboForm").serialize(),
            success: function () {
                layer.msg('修改成功', {icon: 6});
            }
        });
    };
    $("#referBut").click(function () {
        // ignore: ":hidden:not(select)";//解决无法校验select
        // $("#referBut").submit();//button按钮变为submit
        updateCombo();
        $("#cancelBut").click();
    });
    $("#cancelBut").click(function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.getComboList();
        parent.layer.close(index);
    })

</script>